﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace tjb.Utility.IConfig
{
    /// <summary>
    /// 
    /// </summary>
    public class FileWatchManage
    {
        /// <summary>
        /// 监视对象列表
        /// </summary>
        private Dictionary<string, FileSystemWatcher> watcherList = new Dictionary<string, FileSystemWatcher>();

        public void Push(string dirPath, FileSystemWatcher watcher)
        {
            if (Directory.Exists(dirPath) && watcherList.ContainsKey(dirPath))
            {
                watcherList.Add(dirPath, watcher);
                
            }
            else
            {
                watcherList[dirPath] = watcher;
            }
        }
    }
}
